Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#6616: createSelectFork does not fork latest block number if you sleep #7087

Merged
merged 5 commits into from
Feb 19, 2024

Conversation

grandizzy
Copy link
Collaborator

@grandizzy grandizzy commented Feb 12, 2024

closes #6616

proposed solution for solving #6616, slightly different than suggested #6616 (comment) (in the sense that url@latest fork id was made obsolete and instead url@latest_block is recorded)

Motivation

Solution

  • if no block provided then fork is created using latest block for fork id (url@latest_block). if block provided then fork id is url@provided_block (this means there'll no longer be a url@latest fork id but always url@block)

  • after creation of fork the id is checked if in inserted forks. If it doesn't exist then it's inserted, otherwise the existing backend is reused and a new fork url@latest_block-1 recorded

  • changed CreatedFork::inc_senders to increment number of senders and return the new unique fork id. CreatedFork::num_senders was removed

  • MultiForkHandler::insert_new_fork added to handle fork insertion / send on channels

  • added Issue6616Test to cover scenario, looping for 50 seconds should suffice with the current average block time of 12

…rk id (url@latest_block). if block provided then fork id is url@provided_block (this means there'll no longer be a url@latest fork id but always url@block)

- after creation of fork the id is checked if in inserted forks. If it doesn't exist then it's inserted, otherwise the existing backend is reused and a new fork url@latest_block-1 recorded

CreatedFork::inc_senders increments number of senders and returns the new unique fork id. CreatedFork::num_senders was removed
MultiForkHandler::insert_new_fork added to handle fork insertion / send on channels
@grandizzy grandizzy marked this pull request as ready for review February 13, 2024 06:34
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great, ty!

sorry for the delay

@mattsse mattsse merged commit 2e5a603 into foundry-rs:master Feb 19, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

createSelectFork does not fork latest block number if you sleep
2 participants